# -*- coding: utf-8 -*-
"""Personal_translator.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1lHb0mCvF6Ie3QaTt3VfqlNjNs6vuV5qJ
"""

# uncomment the line to intall googletrans library
# ! pip install googletrans

from googletrans import Translator

# make a simple function that will translate any language to english
def text_translator(Text):
    translator = Translator()
    translated = translator.translate(Text, dest="en")
    return translated.text


text_translator(
    "Cidades brasileiras integram programa de preservação de florestas"
)  # portuguese to english

text_translator("Guten Morgen, wie gehts?")  # german to english

text_translator("Ami tumake bhalobashi")  # bengali to english

text_translator("ਮੈਨੂੰ ਇੱਕ ਗੱਲ ਦੱਸੋ")  # punjabi to english

text_translator("I am fine")  # english text remains constant


def eng2punj_translator(Text):  # english to punjabi translator
    translator = Translator()
    translated = translator.translate(Text, dest="pa")
    return translated.text


eng2punj_translator("Meet you soon")


def eng2beng_translator(Text):  # english to bengali translator
    translator = Translator()
    translated = translator.translate(Text, dest="bn")
    return translated.text


eng2beng_translator("So happy to see you")
